package junit.category.testcase;

import junit.category.category.FastTests;
import junit.category.category.SlowTests;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;



/**
 * ①：本类代表的所有测试开始前，@BeforeClass
 * 
 * ②：new出来一个TestCaseA
 * ③：@Before
 * ④：运行某个@Test
 * ⑤：@After
 * 
 * ⑥：本类代表的所有测试结束以后，@AfterClass
 */
public class TestCaseA {
	
	public static int i = 0;
	
	public TestCaseA() {
		i++;
		System.out.println("instance of A created: " + i);
	}
	
	@Before
	public void before() {
		System.out.println("~A.before()");
	}

	@Test
	public void a1() {
		System.out.println("a1");
	}

	@Test
	@Category(FastTests.class)
	public void a2() {
		System.out.println("a2");
	}

	@Test
	@Category(SlowTests.class)
	public void a3() {
		System.out.println("a3");
	}
	
	@After
	public void after() {
		System.out.println("~A.after()");
	}
}
